
                <div class="tableMain">
                    
                    <form method="post" action="index.php?admin=1&c=category&a=edit&id=<?php echo $arr['id'];?>">
                    <label>分类名称:</label><br/><input name="name" type="text" value="<?php echo $arr['name'];?>" /><br/>
                    <label>分类:</label>
                    <p class="select">
                    <?php foreach ($cate as $key => $value):?>
                        <select name="id">  
                          <option  value="0">顶级</option>
                          <?php foreach ($value as $k => $v):?>
                          <option value="<?php echo $v['id'];?>" <?php if($v['id']==$key){echo 'selected="selected"';}?>><?php echo $v['name'];?></option>
                          <?php endforeach;?>
                        </select>
                    <?php endforeach;?>
                    </p>
                    
                    <input type="submit" value="修改"/>
                    </form>   
                   
                </div>
                <div id="page">
                <ul>
				
                </ul>
           		</div>
		   <script>
                $('select').live('change',function(){
                    var id=$(this).val();
                    $(this).nextAll().remove();
                    var index=$(this).get(0).selectedIndex;
                    if(!index){
                        return false;
                    }
                    var url="index.php?admin=1&c=category&a=edit";
                    $.ajax({
                        type:"post",
                        url:url,
                        data:{id:id},
                        dataType:"json",
                        success:function(json){
                            // alert(json);
                            if(json[0]){
                                var str='';
                                str+='<select style="margin-left:10px;" name="id">';
                                str+='<option value="'+id+'">上一级</option>';
                                var i;
                                for (i in json) {
                                    str+='<option value="'+json[i].id+'">'+json[i].name+'</option>';
                                };
                                str+='</select>';

                                $('.select').append(str);
                            }
                        }
                    })
                    
                })
          </script>